package com.qunar.support.util;

import java.text.DateFormat;
import java.util.Date;

import org.junit.Test;

public class TimeHelper {
	private static Date date;

	public static String getLogTime() {
		if (date == null) {
			date = new Date();
		}
		date.setTime(System.currentTimeMillis());
		DateFormat d = DateFormat.getDateTimeInstance();
		String sb = d.format(date);
		return sb;
	}

	@Test
	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println(getLogTime());
			try {
				Thread.currentThread().sleep(1000);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
